<template>
  <PcMapPage v-if="IsPc"></PcMapPage>
  <WebMapPage v-else></WebMapPage>
</template>

<script>
import PcMapPage from '@/views/pc/mapPage/index.vue'
import WebMapPage from '@/views/web/mapPage/index.vue'
export default {
  name: 'homeIndex',
  components: {
    PcMapPage,
    WebMapPage
  },
  data() {
    return {
      IsPc: true
    }
  },
  beforeMount: function () {
    let windowWidth = window.innerWidth
    console.log(windowWidth)
    if (windowWidth > 800) {
      this.IsPc = true
    } else {
      this.IsPc = false
    }
  },
  mounted() {
    window.addEventListener('resize', this.init)
  },
  methods: {
    init() {
      let windowWidth = window.innerWidth
      console.log(windowWidth)
      if (windowWidth > 800) {
        this.IsPc = true
      } else {
        this.IsPc = false
      }
    }
  }
}
</script>
<style lang="scss" scoped></style>
